package sq.vo;

import java.io.Serializable;

/**
 * API接口应答类
 *
 * @Author sunquan
 */
public class BaseRespVO<T extends Serializable> implements Serializable {
    /**
     * 应答结果码，正常返回0
     */
    private String code;

    /**
     * 数据,查询后返回的数据信息
     */
    private T data;

    /**
     * 信息,{@link #code}不为0时,可以通过这个这个字段知道具体的错误信息
     */
    private String msg;

    /**
     * 全参构造方法
     *
     * @param code 应答结果码
     * @param msg  应答消息
     * @param data 应答数据
     */
    public BaseRespVO(String code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public BaseRespVO(String code, String msg){
        this.code=code;
        this.msg=msg;
    }

    public BaseRespVO() {
        super();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
